-
Notifications
You must be signed in to change notification settings - Fork 10
feat: Allow copying text from the terminal #427
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
You can now copy selected text via right click or ctrl+c Signed-off-by: David Hettinger <[email protected]>
The problem I can see with mapping the ctrl-c key to Copy is that, if we want to have the same mapping on the terminal tab (which would be a good experience for user), this will not send anymore the ctrl-c character to the terminal. On Linux it is generally Ctrl-shift-C, on Mac Cmd-C (not sure on Windows) |
Signed-off-by: David Hettinger <[email protected]>
Yup, good catch. I'll still copy on ctrl/command-c if there is text highlighted but allow the terminal to process the command as usual after. |
|
There is still an unexpected behaviour for the user, by pressing ctrl-c I would not expect to copy anything to the clipboard, but just send this character. That would overwrite what I have in it |
|
Hello @adameska , I have added some info on an issue tracking the same problem on Podman Desktop: podman-desktop/podman-desktop#4130 (comment) For your situation, I can see these different possibilities to be able to copy-paste (you are working on a Windows system if I understand correctly?):
|
Thanks for the info, i've gotten fairly busy with work but when i find time i'll hook into the env to determine mac vs windows to alter the command/ctrl key checking. I think the context menu would be nice but that's pretty non-standard in a terminal window from my experience. |
I've created a PR to help you get the platform from the frontend: #465 |
Signed-off-by: David Hettinger <[email protected]>
Signed-off-by: David Hettinger <[email protected]>
This is great! Thanks so much for adding this, I've incorporated your changes and stream lined copy shortcut behavior with right click (this is how my windows terminal functions and it's a great experience to me). |
feloy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add in the PR description all the effects added to the terminal, for reviewers to have a clear understanding of the changes? (right click, which shortcut depending on platform, etc)
Signed-off-by: David Hettinger <[email protected]>
Signed-off-by: Hettinger, David <[email protected]>
Signed-off-by: Hettinger, David <[email protected]>
Signed-off-by: David Hettinger <[email protected]> Signed-off-by: Adameska <[email protected]>
Add remote mocks for API_SYSTEM in tests Signed-off-by: David Hettinger <[email protected]>
feloy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested OK:
On Linux:
- ctrl-shift-c copies the text
- right-click copies the word below the pointer
On Windows:
- Ctrl-c copies the text
- right-click copies the word below the pointer
On Mac:
- Cmd-c copies the text
- right-click copies the word below the pointer
Thanks @adameska for this work!
benoitf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the component should not have like a workaround to copy text, but delegates to the API provided
Signed-off-by: Adameska <[email protected]>
gastoner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screencast_20251120_114154.webm
I was not able to copy the text on Linux using ctrl+shift+c nor ctrl+c :(
Looking at the kubernetes logo in the menu (which is gray), you are testing the internal kubernetes, not the extension (with a blue icon in the menu) |

You can now copy selected text via right click or ctrl+c